
#include "gtest/gtest.h"

#include "LinkedQueue.h"

TEST( LinkedQueueTest, Simple )
{
    int x;
    LinkedQueue<int> Q;

    Q.Add( 1 ).Add( 2 ).Add( 3 ).Add( 4 );

    Q.Delete( x );
    EXPECT_EQ( 1, x );
    EXPECT_EQ( 2, Q.First() );
    EXPECT_EQ( 4, Q.Last() );

    Q.Delete( x );
    EXPECT_EQ( 2, x );
    Q.Delete( x );
    EXPECT_EQ( 3, x );
    Q.Delete( x );
    EXPECT_EQ( 4, x );

    EXPECT_THROW( Q.Delete( x ), class OutOfBounds );
}

#include "main_stub.h"

